﻿using CinemaMaestro.DataLayer.Contracts.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace CinemaMaestro.WebApplication.Models
{
    public class RoomViewModels
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public int Capacity { get; set; }

        public virtual CinemaViewModels Cinema { get; set; }

        public static implicit operator RoomViewModels(Room room)
        {
            return new RoomViewModels
            {
                Id = room.Id,
                Name = room.Name,
                Capacity = room.Capacity,
                Cinema = room.Cinema
            };
        }

        public static implicit operator Room(RoomViewModels roomVM)
        {
            return new Room
            {
                Id = roomVM.Id,
                Name = roomVM.Name,
                Capacity = roomVM.Capacity,
                Cinema = roomVM.Cinema
            };
        }

        public override string ToString()
        {
            return Name;
        }
    }
}